<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><s:if test="%{employee==null}"> 添加员工 </s:if>
 <s:else>员工详细信息 </s:else></title>
<sj:head />
<script src="js/jquery.validate.js" type="text/javascript"></script> 
<script src="js/messages_cn.js" type="text/javascript"></script> 
<script type="text/javascript"> 

$().ready(function() {
	// validate signup form on keyup and submit
	$("#emform").validate({
		rules: {
			"employee.name":{
				required: true,
				minlength: 2},
			"employee.employeeacc":{
				required: true,
				minlength: 10,
				number:true},
				"employee.birthday":{
					required: true,
					date:true
					},
					"employee.nationality":{
						required: true
						
						},
					"employee.politics":{
						required: true
						
						},
					"employee.birthplace":{
						required: true
						
						},
					"employee.telphone":{
						required: true,
						number:true
						},
					"employee.address":{
						required: true
						
						},
					"employee.graduatedSchool":{
						required: true
						
						},
					"employee.specialize":{
						required: true
						
						},
					"employee.education":{
						required: true
						
						},
					"employee.workType":{
						required: true
						
						},
					"employee.firstWorkTime":{
						required: true,
						date:true
						},
					"employee.regedisTtime":{
						required: true,
						date:true
						},
						"employee.regedistName":{
							required: true
						
							},
							"employee.identifycation":{
							required: true,
							minlength: 10,
							number:true
							}
						
						
	        
		   }
		})
	;});
</script> 
 
<style type="text/css"> 
#emform { }
#emform label { }
#emform label.error, #emform input.submit {  }

</style> 

</head>
<body>
<div id="main">
 <h3><s:if test="%{employee==null}"> 添加员工 </s:if>
 <s:else>员工详细信息 </s:else></h3>
  <div>
    <form id="emform" action="hremAction!add" method="post">
    <input type="hidden" name="id" value="<s:property value="employee.id" />" />
     <table >
     <tr>
     <s:if test="%{employee!=null}">
     <td>ID</td>
      <td><input type="text" name="employee.id" value="<s:property value="employee.id" />" /></td>
       </s:if>
</tr>
 <tr>
    <td>姓名</td>
    <td> 
          <input type="text" name="employee.name" value="<s:property value="employee.name" />"  /></td>
  </tr>
  
   <tr>
 <td>性别</td>
    <td>  <s:if test="%{null!=employee&&employee.sex==\"男\"}">
            <input type="radio" name="employee.sex" value="男"  checked="checked" />
            男
            <input type="radio" name="employee.sex" value="女" />
            女</s:if>
          <s:else>
            <input type="radio" name="employee.sex" value="男"   />
            男
            <input type="radio" name="employee.sex" value="女"  checked="checked"/>
            女 </s:else></td>
</tr>
 <tr>
    <td>帐号</td>
    <td> <input type="text" name="employee.employeeacc"  value="<s:property value="employee.employeeacc" />"  /></td>
  </tr>
  
<s:if test="%{employee!=null}">
  <tr>
    <td>年龄</td>
    <td> <input type="text" name="employee.age" value="<s:property value="employee.age" />" /></td>
 </tr>
 </s:if>
 <tr>
    <td>身份证号</td>
    <td><input type="text" name="employee.identifycation"value="<s:property value="employee.identifycation" />" /></td>
  </tr>
  <tr>
    <td>出生日期</td>
    <td><sj:datepicker value="%{employee.birthday}"
		name="employee.birthday" displayFormat="yy-mm-dd" changeYear="true"
		changeMonth="true"   /><label for="employee.birthday" generated="true" class="error"></label></td>
		</tr>
 <tr>
    <td>民族</td>
    <td> <input type="text" name="employee.nationality" value="<s:property value="employee.nationality" />" /></td>
  </tr>
  <tr>
    <td>是否结婚</td>
    <td><s:if test="%{null!=employee&&1==employee.isMarried}">
            <input type="radio" name="employee.isMarried" value="1"  checked="checked" />
            是
            <input type="radio" name="employee.isMarried" value="0" />
            否</s:if>
          <s:else>
            <input type="radio" name="employee.isMarried" value="1"   />
            是
            <input type="radio" name="employee.isMarried" value="0"  checked="checked"/>
            否 </s:else></td>
            </tr>
 <tr>
    <td>政治面貌</td>
    <td><input type="text" name="employee.politics" value="<s:property value="employee.politics" />"  /></td>
  </tr>


  <tr>
    <td>籍贯</td>
    <td><input type="text" name="employee.birthplace"value="<s:property value="employee.birthplace" />" /></td>
   </tr>
 <tr>
    <td>电话</td>
    <td> <input type="text" name="employee.telphone"value="<s:property value="employee.telphone" />"   /></td>
  </tr>
  <tr>
    <td>住址</td>
    <td>  <input type="text" name="employee.address"value="<s:property value="employee.address" />"  /></td>
   </tr>
 <tr>
    <td>毕业学校</td>
    <td> <input type="text" name="employee.graduatedSchool"value="<s:property value="employee.graduatedSchool" />" /></td>
  </tr>
  <tr>
    <td>所学专业</td>
    <td><input type="text" name="employee.specialize"value="<s:property value="employee.specialize" />"  /></td>
    </tr>
 <tr>
    <td>文化程度</td>
    <td><input type="text" name="employee.education"value="<s:property value="employee.education" />" /></td>
  </tr>

 <tr>
    
    <td>工种</td>
    <td><input type="text" name="employee.workType" value="<s:property value="employee.workType" />"  /></td>

  </tr>
  <tr>
    
    <td>开始工作时间</td>
    <td> <sj:datepicker value="%{employee.firstWorkTime}" name="employee.firstWorkTime" displayFormat="yy-mm-dd" changeYear="true" changeMonth="true" /></td>
   </tr>
 <tr>
    <td>登记时间</td>
    <td><sj:datepicker value="%{employee.regedisTtime}" name="employee.regedisTtime" displayFormat="yy-mm-dd" changeYear="true" changeMonth="true"   /></td>
  </tr>
   <tr>
    <td>登记人</td>
    <td> <input type="text" name="employee.regedistName" value="<s:property value="employee.regedistName" />"  /></td>
   </tr>
 <tr>
    <td>备注信息</td>
    <td><input type="text" name="employee.remark" value="<s:property value="employee.remark" />" /></td>
  </tr>
   <tr>
    <td> <input type="reset" name="重置" value="重置" /></td>
    <td>  <input type="submit"
	name="提交" value="提交" /></td>

  </tr>
  
  
</table>
    

      
    
    </form>
  </div>
  <a href="hremAction!emPageList">返回列表</a>
  <s:debug></s:debug>
</div>
</body>
</html>